//
//  FSThirdCellPhoneController.m
//  WZSOA
//
//  Created by 刘沿 on 16/7/18.
//  Copyright © 2016年 刘沿. All rights reserved.
//

#import "FSThirdCellPhoneController.h"

@interface FSThirdCellPhoneController ()

@property (weak, nonatomic) IBOutlet UILabel *telPhoneLabel;

@property (weak, nonatomic) IBOutlet UILabel *firstLabel;

@property (weak, nonatomic) IBOutlet UILabel *nameLabel;

@property (weak, nonatomic) IBOutlet UILabel *dutiesLabel;

@property (weak, nonatomic) IBOutlet UILabel *shortLabel;

@property (weak, nonatomic) IBOutlet UILabel *zuojiLbel;


@end

@implementation FSThirdCellPhoneController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.firstLabel.layer.cornerRadius = 10;
    self.firstLabel.layer.masksToBounds = YES;
    self.tableView.separatorStyle = NO;

    [self loadData];
}

- (void)loadData{

    NSArray *array = @[@{@"unid":self.unid},@{@"name":self.name}];
    
    [HttpTools requestWithURL:Kexchother arrays:array method:KcontentTxl success:^(id JSON) {
        
        NSArray *tempArray = JSON[@"data"];
        
        NSDictionary *dict = tempArray.firstObject;
        
        self.nameLabel.text = dict[@"name"];
        
        self.dutiesLabel.text = [NSString stringWithFormat:@"职务:%@",dict[@"duties"]];
        
        self.telPhoneLabel.text = dict[@"telphone"];
        
        self.firstLabel.text = dict[@"surname"];
        
        self.shortLabel.text = dict[@"officephone"];
        
        self.zuojiLbel.text = dict[@"cornet"];
        
        if (self.telPhoneLabel.text.length == 0) {
            
           self.telPhoneLabel.text = @"";
        }
        
        if (self.shortLabel.text.length == 0) {
            
            self.shortLabel.text = @"";
        }
        
        if (self.zuojiLbel.text.length == 0) {
            
            self.zuojiLbel.text = @"";
        }
        
        
    } failure:^(NSError *error) {
        
    }];
    


}





@end
















